import { useSelector } from "react-redux";
import { StateType } from "../store";
import { userinfoType } from "../store/userInfo";

//包装成自定义hooks

function useGetUserInfo_redux() {
  const { username, nickname } = useSelector<StateType>((state) => {
    return state.userReducer;
  }) as userinfoType;
  return { username, nickname };
}

export default useGetUserInfo_redux;
